package com.jvtd.demo.recyclerView;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.util.AttributeSet;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.jvtd.widget.emptyView.JvtdEmptyView;
import com.jvtd.widget.recyclerView.JvtdRecyclerView;

public class DemoRecyclerView extends JvtdRecyclerView<RvBean> {
    public DemoRecyclerView(@NonNull Context context) {
        super(context);
    }

    public DemoRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public DemoRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public BaseQuickAdapter initAdapter() {
        return new DemoAdapter();
    }

    @Override
    public LayoutManager initLayoutManager() {
        return new GridLayoutManager(mContext,3);
    }

    @Override
    public boolean isFirst() {
        return true;
    }

    @Override
    public int getLoadNum() {
        return 10;
    }

    @Override
    protected void configEmptyView(JvtdEmptyView emptyView) {
        emptyView.setLoadingText("加载中，请稍后...");
        emptyView.setErrorText("加载失败了哦，点我重试~~~");
        emptyView.setEmptyText("没有数据哦~~~");
        emptyView.setEmptyTips("请点击功能键玩耍~~~");
        emptyView.setEmptyImage(0);
        emptyView.setErrorImage(0);
        emptyView.setEmptyBtnText("功能~~~");
    }
}
